package com.scheduling.product.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 工序原料关联数据传输对象
 *
 * @author 开发团队
 * @since 2025-05-29
 */
@Data
@Schema(description = "工序原料关联信息")
public class OperationMaterialDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "工序ID", required = true)
    @NotBlank(message = "工序ID不能为空")
    private String operationId;

    @Schema(description = "原料ID", required = true)
    @NotBlank(message = "原料ID不能为空")
    private String materialId;

    @Schema(description = "用量", required = true)
    @NotNull(message = "用量不能为空")
    @DecimalMin(value = "0", message = "用量不能小于0")
    private BigDecimal quantity;

    @Schema(description = "单位", required = true)
    @NotBlank(message = "单位不能为空")
    private String unit;

    @Schema(description = "原料名称")
    private String materialName;
} 